import { ResourceTypeEnums } from '@/pages/BaseManage/ResourceManage/entity';
import { Form, Input, Select } from '@alifd/next';

interface Props {
  submit: (values: any, item: any) => void;
  field: any;
  parentId: number;
}

function Filter({ submit, field, parentId }: Props) {
  return (
    <Form responsive colon fullWidth labelAlign="left" labelTextAlign="left" field={field} onChange={submit}>
      <Form.Item colSpan={4} label="parentId" disabled style={{ display: 'none' }}>
        <Input name="parentId" hasClear defaultValue={parentId} />
      </Form.Item>
      <Form.Item colSpan={4} label="资源名称">
        <Input placeholder="请输入" name="name" hasClear />
      </Form.Item>
      <Form.Item colSpan={4} label="资源类型">
        <Select name="type" placeholder="请选择" hasClear dataSource={ResourceTypeEnums} />
      </Form.Item>
    </Form>
  );
}

export default Filter;
